package com.erp.dto;

import java.util.Date;

import com.erp.domain.TReply;
import com.erp.domain.TTopic;

@SuppressWarnings("serial")
public class Topic extends Article implements java.io.Serializable {

	private String title; // 标题
	private Integer replyCount = 0;// 回复数量默认0
	private Integer maxFloor = 0;// 最大楼层
	private Reply lastReply;// 最后回复
	private Date lastUpdateTime;// 最后更新时间（主题发表时间或最后回复的时间）
	private Forum forum;// 所属版块

	public Topic() {
	}

	public Topic(TTopic tTopic) {
		super(tTopic);
		this.title = tTopic.getTitle();
		this.replyCount = tTopic.getReplyCount();
		this.maxFloor = tTopic.getMaxFloor();
		TReply tReply = tTopic.getLasttReply();
		if (tReply != null) {
			this.lastReply = new Reply(tReply);
		}
		this.lastUpdateTime = tTopic.getLastUpdateTime();
		this.forum = new Forum(tTopic.gettForum());
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Integer getReplyCount() {
		return replyCount;
	}

	public void setReplyCount(Integer replyCount) {
		this.replyCount = replyCount;
	}

	public Integer getMaxFloor() {
		return maxFloor;
	}

	public void setMaxFloor(Integer maxFloor) {
		this.maxFloor = maxFloor;
	}

	public Reply getLastReply() {
		return lastReply;
	}

	public void setLastReply(Reply lastReply) {
		this.lastReply = lastReply;
	}

	public Date getLastUpdateTime() {
		return lastUpdateTime;
	}

	public void setLastUpdateTime(Date lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}

	public Forum getForum() {
		return forum;
	}

	public void setForum(Forum forum) {
		this.forum = forum;
	}

}
